<div class="score">
    试卷得分：<b>{$row.score}</b>
</div>

<div>
    {foreach $answers as $key=>$value}
        <div class="question">
            <div class="line title">
                {$key+1}. {$value.title} ({$value.type})
            </div>
    
            <div class="line">
                <div>
                    正确答案：
                </div>
                {$value.answer_right}
            </div>
    
            <div class="line {$value.grade == 0?'error':'success'}">
                <div>
                    我的答案：
                </div>
                {$value.answer_mine}
            </div>
    
            <div class="line">
                <div>
                    得分：
                </div>                
                <input type="number" class="grade-input" value="{$value.grade|htmlentities}">
                <button class="btn btn-success btn-update-record" data-record_id="{$value.record_id}" data-question_id="{$value.question_id}">更新得分</button>
            </div>
    
            
            <div class="line">
                <div>
                    解析：
                </div>
                {$value.answerscontent}
            </div>
        </div>
    {/foreach}
</div>

<style>
    .question{
        margin: 10px 0;
        background-color: #f5f5f5;
        padding: 15px;
        border-radius: 15px;
    }

    .title{
        font-weight: bold;
        font-size:16px;
    }

    .line{
        margin: 10px 0;
    }

    .error{
        color:red;
    }

    .success{
        color:green;
    }

    .grade-input{
        width:100px;
        border-radius: 5px;
        padding: 3px 5px;
    }
</style>